package com.qiangesoft.pay.app.service;

import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import com.wechat.pay.java.service.payments.model.Transaction;

/**
 * 支付服务
 */
public interface IPayService {

    /**
     * 支付
     *
     * @param openId
     * @param outTradeNo
     * @param totalFee
     * @param description
     * @return
     */
    PrepayWithRequestPaymentResponse pay(String openId, String outTradeNo, Integer totalFee, String description);

    /**
     * 关闭
     *
     * @param outTradeNo
     * @return
     */
    void close(String outTradeNo);

    /**
     * 支付查询
     *
     * @param outTradeNo
     * @return
     */
    Transaction query(String outTradeNo);

    /**
     * 支付回调
     *
     * @param transaction
     * @return
     */
    void notify(Transaction transaction);

}
